home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / System / Sample 2.4 Think C distribution / makefile < prev    next >
Encoding:
Makefile  |  1990-07-07  |  5.6 KB  |  231 lines  |  [TEXT/KAHL]

  1. #    makefile - Sample make file.
  2. #
  3. #    Targets:
  4. #    --------
  5. #
  6. #    Sample - Sample program.  Default = debugging symbols.
  7. #    wrap, cvrt - Tools.
  8. #
  9. #    Shell scripts:
  10. #    --------------
  11. #
  12. #    rel - Build release version, with no debugging symbols.
  13. #
  14. #    Tools.  (r) = reusable, public:
  15. #    -------------------------------
  16. #    
  17. #    wrap - Wrap paragraphs. (r)
  18. #    cvrt - Compile document. (r)
  19. #    
  20. #    General-purpose C modules.  Reusable:
  21. #    -------------------------------------
  22. #    
  23. #    utl - Utilities.
  24. #    gff - Get file or folder.
  25. #    vol - Volume selection.
  26. #    scn - Volume scanning.
  27. #    rep - Report manager.
  28. #    rpp - Report printing manager.
  29. #    ldf - Custom list definition function for reports.
  30. #    hlp - Help window manager.
  31. #    
  32. #    Other C Modules.:
  33. #    -----------------
  34. #    
  35. #    glob - Global definitions.
  36. #    init - Initialization.
  37. #    misc - Miscellany.
  38. #    wstm - Window state manager.
  39. #    mssg = Message manager.
  40. #    scan - Scanning manager.
  41. #    abou - About window manager.
  42. #    help - Help window manager.
  43. #    pref - Preferences window manager.
  44. #    main - Main window manager.
  45. #    prog - Main program.
  46. #    
  47. #    precompile - Precompile standard system header files.
  48. #
  49. #    Assembler modules:
  50. #    ------------------
  51. #
  52. #    unmount - UnmountVol trap patch.
  53. #
  54. #    Resource files:
  55. #    ---------------
  56. #
  57. #    picts - Pictures.
  58. #     sounds - Sounds.
  59. #    rez.r - All other resources.
  60. #
  61. #    Other files:
  62. #    ------------
  63. #
  64. #    rez.h - Constant definitions for the resources.
  65. #    doc - About window text as maintained in MS Word.
  66. #    rephead.t - Initial text for the report field.
  67. #
  68. #    C Coding conventions:
  69. #    ---------------------
  70. #
  71. #    Public reusable c modules have three character names.
  72. #    Private c modules have four character names.
  73. #
  74. #    References to exported types and functions are always qualified 
  75. #    by the module name:
  76. #
  77. #        module name_type name
  78. #        module name_function name
  79. #
  80. #    e.g., prog_DoEvent.
  81. #
  82. #    Global variable and type names have their first letter capitalized.
  83. #    Local variable and type names have their first letter in lower case.
  84. #    Module names are all lower case.
  85. #    Constant names are all lower case.
  86. #
  87. #    With a few exceptions, all code in a module is placed in its own 
  88. #    segment, with the segment name equal to the module name.  The segments
  89. #    are combined in the link command.
  90.  
  91.  
  92. #    Assembly, compilation, and linking options.
  93. #
  94. #    The debugging options should be turned off when building release versions.  
  95. #    See the "rel" shell script.
  96.  
  97. AOptions = -wb
  98. COptions = -mbg ch8 -sym on -r
  99. LDebugOptions = -sym on
  100.  
  101. #    Sample object files.
  102.  
  103. ObjFiles =     prog.c.o ∂
  104.             main.c.o ∂
  105.             glob.c.o ∂
  106.             vol.c.o ∂
  107.             scn.c.o ∂
  108.             rep.c.o ∂
  109.             rpp.c.o ∂
  110.             hlp.c.o ∂
  111.             gff.c.o ∂
  112.             utl.c.o ∂
  113.             abou.c.o ∂
  114.             wstm.c.o ∂
  115.             mssg.c.o ∂
  116.             scan.c.o ∂
  117.             init.c.o ∂
  118.             misc.c.o ∂
  119.             pref.c.o ∂
  120.             help.c.o ∂
  121.             unmount.a.o
  122.  
  123. #    Additional dependencies for C and assembler modules.  MPW's default
  124. #    rules and build commands are used for these modules.
  125.  
  126. abou.c.o ƒ precompile utl.h rez.h rpp.h glob.h wstm.h abou.h help.h
  127. gff.c.o ƒ precompile gff.h
  128. glob.c.o ƒ precompile rpp.h rez.h glob.h
  129. help.c.o ƒ precompile utl.h rpp.h rez.h hlp.h glob.h ∂
  130.     wstm.h help.h misc.h main.h unmount.h vol.h
  131. hlp.c.o ƒ precompile rep.h rpp.h utl.h hlp.h doc.h
  132. init.c.o ƒ precompile utl.h rpp.h rez.h glob.h ∂
  133.     pref.h help.h init.h misc.h main.h abou.h prog.h
  134. main.c.o ƒ precompile vol.h rep.h rpp.h scn.h utl.h rez.h glob.h ∂
  135.     wstm.h misc.h scan.h help.h prog.h main.h unmount.h mssg.h
  136. misc.c.o ƒ precompile utl.h rep.h rpp.h scn.h vol.h rez.h glob.h ∂
  137.     unmount.h misc.h wstm.h unmount.h prog.h main.h mssg.h
  138. mssg.c.o ƒ precompile utl.h rep.h scn.h vol.h rpp.h rez.h glob.h mssg.h
  139. pref.c.o ƒ precompile utl.h rpp.h rez.h glob.h wstm.h pref.h help.h
  140. prog.c.o ƒ precompile vol.h scn.h rep.h rpp.h hlp.h utl.h rez.h ∂
  141.     glob.h wstm.h abou.h pref.h help.h misc.h ∂
  142.     init.h prog.h main.h mssg.h
  143. rep.c.o ƒ precompile rep.h utl.h doc.h
  144. rpp.c.o ƒ precompile rpp.h utl.h doc.h
  145. scn.c.o ƒ precompile scn.h utl.h
  146. utl.c.o ƒ precompile utl.h
  147. vol.c.o ƒ precompile vol.h utl.h
  148. scan.c.o ƒ precompile utl.h rpp.h rep.h vol.h rez.h scn.h gff.h ∂
  149.     glob.h misc.h main.h prog.h
  150. wstm.c.o ƒ precompile utl.h rpp.h rez.h glob.h wstm.h
  151. unmount.a.o ƒ precompile unmount.h
  152.  
  153. #    Precompiled system headers.
  154.  
  155. precompile ƒ precompile.c
  156.     C {COptions} precompile.c
  157.  
  158. #    List definition procedure.
  159.  
  160. ldf.c.o ƒ ldf.c doc.h precompile
  161.     C {COptions} ldf.c -o ldf.c.o -r -w    
  162.     
  163. #    Sample dependencies.
  164.  
  165. Sample ƒƒ rez.r picts sounds
  166.     Rez rez.r -a -o Sample
  167.     
  168. Sample ƒƒ rephead.t cvrt
  169.     cvrt rephead.t -o Sample -i 150
  170.     
  171. Sample ƒƒ doc wrap cvrt picts
  172.     wrap -r 335 -p <doc >wraptemp 
  173.     cvrt wraptemp -o Sample -i 200 -t 128 -g 128 -c 128 ∂
  174.         -p picts -w 345 -h 12
  175.     delete wraptemp
  176.  
  177. Sample ƒƒ {ObjFiles}
  178.     Link -t APPL -c SAMP -ra =$30 {LDebugOptions} ∂
  179.         -sg main1seg=Main,prog,utl,misc,main ∂
  180.         -sg main2seg=wstm,vol,rep,repi,misc,scn,scan,mssg ∂
  181.         -sg initseg=init,voli ∂
  182.         -sg auxseg=abou,help,pref,hlp,gff ∂
  183.         -sg rppseg=rpp ∂
  184.         {ObjFiles} ∂
  185.         "{Libraries}"Interface.o ∂
  186.         "{CLibraries}"CRuntime.o ∂
  187.         "{CLibraries}"StdCLib.o ∂
  188.         "{CLibraries}"CInterface.o ∂
  189.         -o Sample
  190.     Setfile -a B Sample
  191.         
  192. Sample ƒƒ ldf.c.o
  193.     Link -rt LDEF=128 -m MYLIST ∂
  194.          ldf.c.o ∂
  195.         "{Libraries}"Interface.o ∂
  196.         -o Sample
  197.         
  198. #    wrap tool.        
  199.         
  200. wrap.c.o ƒ wrap.c precompile
  201.     C {COptions} wrap.c -w
  202.     
  203. wrapObjects = wrap.c.o
  204.  
  205. wrap ƒ {wrapObjects}
  206.     Link -w -c 'MPS ' -t MPST ∂
  207.         {wrapObjects} ∂
  208.         "{Libraries}"stubs.o ∂
  209.         "{CLibraries}"CRuntime.o ∂
  210.         "{Libraries}"Interface.o ∂
  211.         "{CLibraries}"StdCLib.o ∂
  212.         "{CLibraries}"CInterface.o ∂
  213.         -o wrap
  214.         
  215. #    cvrt tool.        
  216.         
  217. cvrt.c.o ƒ cvrt.c doc.h precompile
  218.     C {COptions} cvrt.c
  219.     
  220. cvrtObjects = cvrt.c.o
  221.  
  222. cvrt ƒ {cvrtObjects}
  223.     Link -w -c 'MPS ' -t MPST ∂
  224.         {cvrtObjects} ∂
  225.         "{Libraries}"stubs.o ∂
  226.         "{CLibraries}"CRuntime.o ∂
  227.         "{Libraries}"Interface.o ∂
  228.         "{CLibraries}"StdCLib.o ∂
  229.         "{CLibraries}"CInterface.o ∂
  230.         -o cvrt
  231.